<!doctype html>
<html>
<head>
<meta charset="utf-8">
<title>不同时间段显示不同的问候语</title>
</head>

<body>
<script language="javascript" type="text/javascript">
<!--
var today , hour ;
today = new Date();
hour = today.getHours() ;
if(hour < 8){document.write("&nbsp;早上好!") ;}
  else if(hour < 12){document.write("&nbsp;上午好!") ;}
	else if (hour < 14){document.write("&nbsp;中午好!") ;}
		else if (hour < 17){document.write("&nbsp;下午好!") ;}
			else           {document.write("&nbsp;晚上好!") ;}
// -->
 </script>
</body>
</html>
